package cn.gailvlun.gll.widget.edittext

import cn.gailvlun.gll.util.ToastUtil


class DigitsFilter(private val mType: FilterType) : BaseFilter() {
    override fun isAllowed(c: Char): Boolean {
        if (c in '0'..'9') {
            return true
        } else {
            when (mType) {
                FilterType.CAPTCHA -> {
                    ToastUtil.showShort("验证码有误，请重新输入")
                }
                FilterType.PHONE -> {
                    ToastUtil.showShort("手机号有误，请重新输入")
                }



                else -> {
                }
            }
            return false
        }
    }
}